package com.example.reagent_management.ui.operatedialog.viewmodle

import androidx.lifecycle.ViewModel
import com.example.reagent_management.room.entity.ReagentInformation
import com.example.reagent_management.ui.operatedialog.repository.ReagentRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class ReagentInsertViewModel @Inject constructor(
   private val reagentRepository: ReagentRepository
) : ViewModel(){
   suspend fun insertInfo(reagent: ReagentInformation): Long {
      return reagentRepository.insert(reagentInformation = reagent)
   }

   fun delete(id:Long):Int{
      return reagentRepository.deleteById(id)
   }

   fun update(info:ReagentInformation):Int{
      return reagentRepository.update(info)
   }
}